package 数组;

public class Zuoye03231 {
    String name,number,birthday;
    int a=30;
    String[] stus = new String[a];
    String[] num=new String[a];
    int[] fen=new int[a];
    int[] jiangping={100,400,1000};
    int fenshu;
    public void yonghu(String name,String number){
        for (int i = 0; i < stus.length; i++) {
            if (stus[i] == null) {
                stus[i] = name;
                num[i] = number;
                System.out.println("恭喜您"+stus[i]+"开卡成功！");
                break;
            }
        }
    }
    public boolean inc(String number,int fenshu){
        for (int i = 0; i < stus.length; i++) {
            if (number.equals(num[i])){
                fen[i]=fenshu;
                return true;
            }
        }
        return false;
    }
    public boolean check(String number){
        for (int i = 0; i < stus.length; i++) {
            if (number.equals(num[i])){
                return true;
            }
        }
        return false;
    }
    public boolean duihuan(String number,int liping){
        for (int i = 0; i < stus.length; i++) {
            if (number.equals(num[i])){
                if (jiangping[liping-1]<=fen[i]){
                    return true;
                }
            }
        }
        return false;
    }
}
